package com.ccz.demo.design.builder.computer;

/**
 * @ClassName Director
 * @Author caihaoyun
 * @Date 2020/5/28
 * @Version V1.0
 **/
public class Director {

    private Builder builder;

    public Director(Builder builder) {
        this.builder = builder;
    }

    public Computer createComputer(String cpu, String hardDisk, String mainBoard, String memory) {
        this.builder.createMotherBoard(mainBoard);
        this.builder.createCpu(cpu) ;
        this.builder.createMemory(memory);
        this.builder.createDisk(hardDisk);
        return builder.createComputer();
    }
}
